#include "BinaryTree.h"

#include "Queue.h"

int main() {
    TreeNode* A = TreeNodeCreate(1);
    TreeNode* B = TreeNodeCreate(2);
    TreeNode* C = TreeNodeCreate(3);
    TreeNode* D = TreeNodeCreate(4);
    TreeNode* E = TreeNodeCreate(5);
    A->left = B;
    B->left = C;
    B->right = D;
    A->right = E;

    TreeShow(A, PreOrder);
    TreeShow(A, InOrder);
    TreeShow(A, PostOrder);
    TreeShow(A, LevelOrder);

    printf("count of node: %d\n", TreeSize(A));
    printf("count of leaf_node: %d\n", TreeLeafSize(A));

    int find = 3;
    TreeNode* pos = NULL;
    if (pos = TreeFind(A, find)) {
        printf("find %d at %p\n", find, pos);
    } else {
        printf("not found %d\n", find);
    }

    printf("is_completeBinaryTree_By_BFS: %d\n", TreeCompleteBFS(A));
    printf("is_completeBinaryTree_By_DFS: %d\n", TreeCompleteDFS(A));
    return 0;
}